<?php
/**
 * Name: 公共控制器.
 * User: 董坤鸿
 * Date: 2017/11/21
 * Time: 16:59
 */

namespace app\admin\controller;

use think\Controller;
use think\Request;

class Common extends Controller
{
    /**
     * 初始化
     *
     * Common constructor.
     * @param Request|null $request
     */
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        //执行登录验证
        if (!session('admin.id')) {
            $this->redirect('admin/login/index');
        }
    }
}